<?php

class Purchasing extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
	}
	
	function index()
	{
		$this->approval();
	}	
	
	function approval()
	{
		$data['requisition'] = (object)array(
			'rr_number' => 854834,
			'department' => 'School Supplies',
			'request_date' => date('M. d, Y'),
			'requestor' => (object)array(
				'name' => 'Juan dela Cruz'				
			),
			'approver' => (object)array(
				'name' => 'Pedro Penduko'
			),			
			'canvasser' => (object)array(
				'name' => 'Jose Santos'
			),
			'materials' => array(
				(object)array(
					'id' => 1,
					'name' => 'Ballpen',
					'quantity' => '95',
					'unit' => 'Pcs',					
					'supplier' => (object)array(	
						'name' => "National Bookstore"
					),
					'sourcing' => (object)array(
						'price' => "25.75"
					),
					'history1' => (object)array(
						'supplier' => (object)array(	
							'name' => "National Bookstore"
						),					
						'price' => '27.50',
						'date' => 'Dec. 5, 2010'
					),
					'history2' => (object)array(
						'supplier' => (object)array(	
							'name' => "International Bookstore"
						),					
						'price' => '20.99',
						'date' => 'Oct. 15, 2010'
					)					
				),
				(object)array(
					'id' => 2,
					'name' => 'Paper',
					'quantity' => '50',
					'unit' => 'Rim',					
					'supplier' => (object)array(	
						'name' => "International Bookstore"
					),
					'sourcing' => (object)array(
						'price' => "500"
					),
					'history1' => (object)array(
						'supplier' => (object)array(	
							'name' => "National Bookstore"
						),					
						'price' => '450',
						'date' => 'Mar. 17, 2011'
					),
					'history2' => (object)array(
						'supplier' => (object)array(	
							'name' => "International Bookstore"
						),					
						'price' => '500',
						'date' => 'Jan. 9, 2011'
					)						
				),
				(object)array(
					'id' => 3,
					'name' => 'Paper Clip',
					'quantity' => '250',
					'unit' => 'Boxes',					
					'supplier' => (object)array(	
						'name' => "Local Bookstore"
					),
					'sourcing' => (object)array(
						'price' => "89.99"
					),
					'history1' => (object)array(
						'supplier' => (object)array(	
							'name' => "Local Bookstore"
						),					
						'price' => '95.50',
						'date' => 'Oct. 19, 2010'
					),
					'history2' => (object)array(
						'supplier' => (object)array(	
							'name' => "National Bookstore"
						),					
						'price' => '85.75',
						'date' => 'Aug. 17, 2010'
					)						
				)	
			)
		);
		$data['content'] = $this->load->view("purchasing/approval_view", $data, true);
		
		$data['title'] = array( "Requisitions", "Purchasing Manager", "Approval" );
		$this->load->view("main_view", $data);
	}
	
	function createpo()
	{
		$data = array();
		$data['content'] = $this->load->view("purchasing/create_po_view", $data, true);
		
		$data['title'] = array( "Requisitions", "Purchasing Manager", "Create PO" );
		$this->load->view("main_view", $data);	
	}
}

?>